#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
void print(int x)
{
	char str[10][5] = {"ling","yi","er","san","si","wu","liu","qi","ba","jiu"};
	while (x)
	{
		print(x / 10);
		printf("%5s", str[x % 10]);
		break;
	}
}
int main()
{
	int n = 0, m = 0, i = 0, j = 0, sum = 0;
	char str[10][5] = { "ling","yi","er","san","si","wu","liu","qi","ba","jiu" };
	scanf("%d %d", &n, &m);
	int arr[10][10] = { 0 };
	for (i = 0; i < n; i++) {
		for (j = 0; j < m; j++) {
			scanf("%d", &arr[i][j]);
		}
	}
	for (i = 0; i < n; i += 2)
	{
		for (j = 0; j < m; j++)
		{
			sum+=arr[i][j];
		}
		printf("%d:", sum);
		if (sum)
		{
			print(sum);
		}
		else
		{
			printf("%5s",str[0]);
		}
		printf("\n");
		sum = 0;
	}
	return 0;
}
